q=0
for i in range(1,10):
    for j in range(10):
        for m in range(10):
            for n in range(10):
                k=i+j+m+n
                if k%3==0:
                    q=q+1
print(q)
